
package com.sausageking.shared;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Id;

import com.google.common.base.Objects;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
public class Redemption implements Serializable {
  private static final long serialVersionUID = 4204235641128010086L;

  @Id
  @Indexed
  private Long id;

  @Indexed
  private String email;

  @Indexed
  Long merchantId;

  private Date creationTime;

  public Long getId() {
    return id;
  }

  public Redemption setId(Long id) {
    this.id = id;
    return this;
  }

  public String getEmail() {
    return email;
  }

  public Redemption setEmail(String email) {
    this.email = email;
    return this;
  }

  public Long getMerchantId() {
    return merchantId;
  }

  public Redemption setMerchantId(Long merchantId) {
    this.merchantId = merchantId;
    return this;
  }

  public Redemption setMerchantId(String merchantId) {
    this.merchantId = Long.valueOf(merchantId);
    return this;
  }

  public Date getCreationTime() {
    return creationTime;
  }

  public Redemption setCreationTime(Date creationTime) {
    this.creationTime = creationTime;
    return this;
  }

  public String toString() {
    return Objects.toStringHelper(this).add("id", id).add("email", email)
        .add("merchant", merchantId).add("creationTime", creationTime)
        .toString();
  }

}
